using System;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Xml;

using stsdev;

namespace WebControlSolutionProviders {
  public class ControlBuilder {

    public static void CreateControl(string ControlName) {

        string ControlSourceFilePath = ControlName + ".cs";
        FileStream control_cs = File.Create(ControlSourceFilePath);
        StreamWriter control_cs_writer = new StreamWriter(control_cs);
        string control_content = Properties.Resources.Control_cs;
        control_content = control_content.Replace("@SolutionName", SolutionBuilder.SolutionName);
        control_content = control_content.Replace("@ClassName", ControlName);
        control_cs_writer.Write(control_content);
        control_cs_writer.Dispose();
        control_cs.Dispose();
        ProjectFileBuilder.AddSourceFile(ControlSourceFilePath);
    }
  }
}
